#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 100000;
ll a[maxn], k;
int n;

int main() {
    cin >> n;
    for (int i = 0; i < n; i++)cin >> a[i];
    cin >> k;
    sort(a, a + n);
    for (int i = 0; i < n; i++) {
        ll y = k - a[i];
        int left = i + 1, right = n - 1;
        cerr << "left=" << left << ",right=" << right << endl;
        while (left <= right) {
            int mid = (left + right) / 2;
            if (y == a[mid]) {
                cout << a[i] << " " << y << endl;
                return 0;
            }
            if (y < a[mid]) {
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }

    }
    cout << "No" << endl;


    return 0;
}